# YAL zeldan

PREFIX ?= /usr/local

TARGET := bdz

DOCS := README TODO INSTALL 

GITVER := $(shell git log -n 1 --format="%at")


CPPFLAGS += -DGITVER=$(GITVER) -D_REENTRANT -D_FILE_OFFSET_BITS=64
CFLAGS += -Wall -Wextra -O2 -std=gnu99 -static

TBDIR := $(TARGET)-$(subst :,_,$(GITVER))


all: $(TARGET)

$(TARGET) : bdz.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<


install: $(TARGET)
	install -s $(TARGET) $(PREFIX)/bin
	install *.sh $(PREFIX)/bin


dist:
	mkdir -p $(TBDIR)
	cp -l configure Makefile GNUmakefile $(DOCS) *.c *.sh $(TBDIR)/
	tar zcf $(TBDIR).tar.gz $(TBDIR)
	$(RM) -r $(TBDIR)
	
	
	

.PHONY: clean
clean:
	$(RM) $(TARGET)


#.
